# Contributor: David Demelier <markand@malikania.fr>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=zita-resampler
pkgver=1.10.1
pkgrel=0
pkgdesc="library for resampling audio signals"
url="https://kokkinizita.linuxaudio.org/linuxaudio"
arch="all"
license="GPL-3.0-only"
makedepends="libsndfile-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://kokkinizita.linuxaudio.org/linuxaudio/downloads/zita-resampler-$pkgver.tar.xz
	patch-Makefile.patch"
options="!check" # No tests

build() {
	make -C source
	# Poorly written makefile that may only build apps if the library
	# is installed system wide. Fake it locally.
	ln -sv lib$pkgname.so.$pkgver source/lib$pkgname.so
	make CXXFLAGS="-I../source $CXXFLAGS" LDFLAGS="-L../source $LDFLAGS" -C apps
}

package() {
	make PREFIX=/usr LIBDIR=/usr/lib DESTDIR="$pkgdir" -C source install
	make PREFIX=/usr LIBDIR=/usr/lib DESTDIR="$pkgdir" -C apps install

	# Needed for zita-njbridge and some other MAO software.
	ln -sf libzita-resampler.so.$pkgver "$pkgdir"/usr/lib/libzita-resampler.so.1
}

sha512sums="
ba95286b0744df393194f4f94a8aad62f6c088cf80f6be71482ed55beef6503a9bab6644f2565b69002247611fcf0fb6561fc0072578466a0133311721b43cf5  zita-resampler-1.10.1.tar.xz
787433be1250d83c30e1de129a41fcde4f96679b1e05b644f20ca7d47609cd032e08f1c925bf8cea9a7a66f4225eb64f15516cd010a9ad60534b5c13215aa647  patch-Makefile.patch
"
